<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>

<html>
<head>
    <title>登录页</title>
    <%--echart线图、柱状图、饼图等各种图型库 cdn--%>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/echarts/5.4.3/echarts.min.js"></script>
    <%--jquery cdn--%>
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
</head>
<body>

<form action="list.do">
    类型<select name="typeId">
    <option value="">请选择</option>
    <c:forEach items="${typeList}" var="t">
        <option   ${query.typeId==t.id ? 'selected':''} value="${t.id}">${t.name}</option>
    </c:forEach>
</select><br>
    名称<input name="name" value="${query.name}"><br>

    <input type="submit" value="查询"><br>

    <table>
        <tr>
            <td>id</td>
            <td>名称</td>
            <td>类型</td>
            <td>库存</td>
            <td>单位</td>
            <td>时间</td>
        </tr>


        <c:forEach items="${pageInfo.list}" var="l">

            <tr>
                <td>${l.id}</td>
                <td>${l.name}</td>
                <td>${l.typeName}</td>
                <td>${l.stock}</td>
                <td>${l.unit}</td>
                <td>${l.createTime}</td>
            </tr>
        </c:forEach>

    </table>
    <tr>
        <td>
            <button name="pageNum" value="1">首页</button>
        </td>
        <td>
            <button name="pageNum" value="${pageInfo.prePage}">上页</button>
        </td>
        <td>
            <button name="pageNum" value="${pageInfo.nextPage}">下页</button>
        </td>
        <td>
            <button name="pageNum" value="${pageInfo.pages}">尾页</button>
        </td>
    </tr>

</form>


</body>
</html>